package com.taxigang.client.uibinder;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
import com.taxigang.client.micro.TaxiGangCreator;
import com.taxigang.client.ui.map.MapView.PanelType;
import com.taxigang.client.uibinder.base.CreateStep;

public class CreateStep1 extends CreateStep {

	private static CreateStep1UiBinder uiBinder = GWT
			.create(CreateStep1UiBinder.class);

	interface CreateStep1UiBinder extends UiBinder<Widget, CreateStep1> {
	}

	public CreateStep1() {
		initWidget(uiBinder.createAndBindUi(this));
		willPhoneTaxiButton.setText(TaxiGangCreator.taxiGangConstants.iWillPhoneATaxi());
		willMeetAtTaxiRangButton.setText(TaxiGangCreator.taxiGangConstants.meetAtTaxiRang());
		headerLabel.setText(TaxiGangCreator.taxiGangConstants.step1());

		bindUI();
	}

	@UiField
	Label headerLabel;

	@UiField
	Button willPhoneTaxiButton;
	
	@UiField
	Button willMeetAtTaxiRangButton;
	
	@UiField
	Button backButton;
	
	private void bindUI(){
		willPhoneTaxiButton.addClickHandler(new ClickHandler() {
			
			@Override
			public void onClick(ClickEvent event) {
				taxiGangRoute.show(PanelType.CREATE_STEP2A);
				
			}
		});
		willMeetAtTaxiRangButton.addClickHandler(new ClickHandler() {
			
			@Override
			public void onClick(ClickEvent event) {
				taxiGangRoute.show(PanelType.CREATE_STEP2B);
				
			}
		});
		
		bindControlButtons(backButton,PanelType.MOBILENUMBER);
		
	}
}
